package com.cn.yang.servlet;


import com.cn.yang.service.AboutUsService;
import com.cn.yang.service.MainPageService;
import com.cn.yang.service.impl.AboutUsServiceImpl;
import com.cn.yang.service.impl.MainPageServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/about us")
public class AboutUsServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        //获得headLink的List。
        MainPageService headLink = new MainPageServiceImpl();
        req.setAttribute("headLink",headLink.selectHeadLink());
        //获得头尾 存储的字段，
        MainPageService headFootService = new MainPageServiceImpl();
        req.setAttribute("headFootService",headFootService.selectHeadFoot());
        //===============================================================================
        //
        AboutUsService service = new AboutUsServiceImpl();
        
        req.setAttribute("aboutUsService",service.findAboutUs());
        req.getRequestDispatcher("jsp/about us.jsp").forward(req,resp);
    }
}
